package work20241221;

/**
 * @author zdl
 * @date 2024/12/21
 */
interface USB{
    void mouse();
}
/*class Computer implements USB{
    @Override
    public void mouse() {
        System.out.println("连接鼠标!");
    }
}*/
public class Demo4 {
    public static void main(String[] args) {
        /*Computer computer = new Computer();
        computer.mouse();*/
       /* new USB(){
            @Override
            public void mouse() {
                System.out.println("连接鼠标!");
            }
        }.mouse();*/
       ((USB)() -> System.out.println("连接鼠标!")).mouse();
        Runnable runnable=new Runnable(){
           @Override
           public void run() {
               for (int i = 0; i < 1000; i++) {
                   System.out.println("晚上吃大盘鸡----------》"+i);
               }
           }
       };
       new Thread(runnable).start();
       Runnable  runnable1 = new Runnable() {
           @Override
           public void run() {
               for (int i = 0; i < 1000; i++) {
                   System.out.println("改天在吃----------》"+i);
               }
           }
       };
       new Thread(runnable1).start();

       new Thread(new Runnable() {
           @Override
           public void run() {
               for (int i = 0; i < 1000; i++) {
                   System.out.println("111111----------》"+i);
               }
           }
       }).start();
       new Thread(new Runnable() {
           @Override
           public void run() {
               for (int i = 0; i < 1000; i++) {
                   System.out.println("222222----------》"+i);
               }
           }
       }).start();
    }
}
